package cn.zzdt4j.config.controller;

import cn.zzdt4j.common.constant.Constants;
import cn.zzdt4j.common.model.Result;
import cn.zzdt4j.config.service.biz.HisRunDataService;
import cn.zzdt4j.config.model.biz.monitor.MonitorActiveRespDTO;
import cn.zzdt4j.config.model.biz.monitor.MonitorQueryReqDTO;
import cn.zzdt4j.server.common.base.Results;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * The type Monitor controller.
 *
 * @author by <a href="mailto:ligang941012@gmail.com">gang.Li</a>
 * @since 2023 /11/14 15:32
 */
@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping(Constants.BASE_PATH + "/monitor")
public class MonitorController {

    private final HisRunDataService hisRunDataService;

    @PostMapping("/info")
    public Result<MonitorActiveRespDTO> queryInfoThreadPoolMonitor(@RequestBody MonitorQueryReqDTO reqDTO) {
        return Results.success(hisRunDataService.queryInfoThreadPoolMonitor(reqDTO));
    }
}
